﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IEx
{
    public class RequestQueue : Queue<SourceItem>
    {
        public override bool Contains(SourceItem item)
        {
            return this.itemsQueue.Any(
                request => request.LangId == item.LangId
                            && request.Url.Equals(item.Url, System.StringComparison.OrdinalIgnoreCase)
                            && request.SourceId == item.SourceId
                            && request.SourceCode.Equals(item.SourceCode, System.StringComparison.OrdinalIgnoreCase)
                            && request.SearchCode.Equals(item.SearchCode, System.StringComparison.OrdinalIgnoreCase)
                            && request.DateTimeFormat == item.DateTimeFormat
                            && request.PrevResponseHtml == item.PrevResponseHtml
           );
        }
    }
}
